import 'package:basic_common/common_exports.dart';
import 'package:basic_profile/chilidview/authinfo/authinfo_controller.dart';
import 'package:basic_widgets/image_widget.dart';
import 'package:basic_widgets/input_widget.dart';

class AuthRealNameView extends GetView<AuthInfoController> {
  @override
  Widget build(BuildContext context) {
    return Container(
      height: ScreenHelper.screenHeight - ScreenHelper.height(100),
      child: Column(
        children: [
          buildBaseInfoItem(
              attrName: '姓名', value: controller.identityInfo!.realName ?? ''),
          buildBaseInfoItem(
              attrName: '身份证号', value: controller.identityInfo!.idcardNo ?? ''),
          buildBaseInfoItem(
              attrName: '性别',
              value: controller.identityInfo!.gender == '1' ? '男' : '女'),
          buildBaseInfoItem(
              attrName: '出生年月', value: controller.identityInfo!.birthday ?? ''),
          buildIdCardImg(
              photo1: controller.identityInfo!.photo01!,
              photo2: controller.identityInfo!.photo02!)
        ],
      ),
    );
  }

  Widget buildIdCardImg({required String photo1, required String photo2}) {
    return Container(
      width: ScreenHelper.width(300),
      height: ScreenHelper.height(120),
      child: Row(
        children: [
          Expanded(
              child: SizedBox(
                  child: photo1.isEmpty
                      ? Image.asset(
                          "assets/register/img_card_front.png",
                          width: ScreenHelper.width(122),
                          height: ScreenHelper.height(82),
                          package: "basic_common",
                        )
                      : netWorkImgBox(netPath: photo1))),
          SizedBox(
            width: ScreenHelper.width(15),
          ),
          Expanded(
              child: SizedBox(
                  child: photo2.isEmpty
                      ? Image.asset(
                          "assets/register/img_card_back.png",
                          width: ScreenHelper.width(122),
                          height: ScreenHelper.height(82),
                          package: "basic_common",
                        )
                      : netWorkImgBox(netPath: photo2)))
        ],
      ),
    );
  }
}
